package com.dexgdx.game.manager;

import java.util.ArrayList;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.utils.Json;
import com.dexgdx.game.actor.JSONActor;
import com.dexgdx.game.constants.PlayerType;

public class JSONManager {
	
	@SuppressWarnings("unchecked")
	public static ArrayList<JSONActor> getJSONActor(){
		Json json = new Json();
        return json.fromJson(ArrayList.class, Gdx.files.internal("data/actors.json"));
    }
        
    public static void saveJSONActor(){
		Json json = new Json();
		ArrayList<JSONActor> actors = new ArrayList<JSONActor>();
		actors.add(new JSONActor(PlayerType.PLAYER, true, 10, 10, 10, 10, ""));
		actors.add(new JSONActor(PlayerType.PLAYER, true, 200, 10, 10, 10, ""));
    	String text = json.prettyPrint(actors);
    	System.out.print(text);
    }
}
